<script lang="ts" setup>
	import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
	import { tool } from "@/utils/tool";
	import { useAuth } from "@/store/auth"
	import { urlParamToJson } from "@/hook/useParam"
	const Auth = useAuth();
	onLaunch(() => {
		console.log("App Launch");
		Auth.SET_REDIRECTURL()
	});
	onShow(() => {
		console.log("App Show");
		const queryData = uni.getEnterOptionsSync(); // uni-app版本 3.5.1+ 支持
		console.log(queryData)
		if (queryData.query.token) {
			Auth.SET_TOKEN(queryData.query.token)
		}
		if (queryData.query.invite_user) {
			tool.set('INVITE_USER', queryData.query.invite_user)
		}
		if (!!Auth.TOKEN) {
			Auth.GetUserInfo()
		}
	});
	onHide(() => {
		console.log("App Hide");
	});
</script>
<style lang="scss">
	@import "uview-plus/index.scss";
	@import "@/styles/common.scss";

	/* #ifdef H5 */
	uni-page-head {
		display: none;
	}

	/* #endif */
	page,
	html,
	body {
		background-color: #FCFCFC;
		font-family: PingFangSC, PingFang SC;
		-webkit-overflow-scrolling: touch !important;
		box-sizing: border-box;
		--themeColors: #B41732;
	}
</style>
